package com.jzlin.funhub.admin.model.dto;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jzlin.funhub.admin.model.entity.QuestionAnswer;
import com.jzlin.funhub.admin.model.entity.QuestionAnswerReplies;
import lombok.Data;

import java.util.Date;

/**
 * .
 *
 * @author linjz
 * @since 2025/7/7
 */
@Data
@TableName(autoResultMap = true)
public class QuestionAnswerRepliesPageDTO {
    /**
     * 来源回答id
     */
    private Long source_answer_id;

    /**
     * 父回复id
     */
    private String parent_reply_id;

    /**
     * 回复内容
     */
    private Boolean content;

    /**
     * 是否通过审核
     */
    private Boolean isApproved;

    /**
     * 赞同数
     */
    private Long voteCount;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date createTime;

    /**
     * 创建人
     */
    private String createBy;

    public static QuestionAnswerRepliesPageDTO convert(QuestionAnswerReplies entity) {
        QuestionAnswerRepliesPageDTO result = new QuestionAnswerRepliesPageDTO();
        BeanUtil.copyProperties(entity, result);

        return result;
    }
}
